/*
 * Copyright (c) 2023, 2024,yzc.cn All rights reserved.
 *
 */
package com.by.mq.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



/**
 * <p>Project: erp-cloud-api - FollowMQConsumer</p>
 * <p>Powered by yzc On 2024-01-11 11:39:53</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
@Configuration
public class FollowMQConfig {

    /**
     * 声明采购进度队列
     * @return
     */
    @Bean
    public Queue followQueue(){
        return new Queue("followQueue");
    }

    /**
     * 声明采购进度交换器
     * @return
     */

    @Bean
    public DirectExchange followExchange(){
        return new DirectExchange("followExchange");
    }

    /**
     * 绑定采购进度队列和交换器
     * @param followQueue
     * @param followExchange
     * @return
     */
    @Bean
    public Binding bindingFollow(Queue followQueue,DirectExchange followExchange){
        return BindingBuilder.bind(followQueue).to(followExchange).with("follow");

    }

}
